package Eyjafjalla.card.skill;

import Eyjafjalla.action.ChooseHandToCloudAction;
import Eyjafjalla.action.MelodyAction;
import Eyjafjalla.card.AbstractEyjafjallaCard;
import Eyjafjalla.helper.EyjafjallaHelper;
import Eyjafjalla.modcore.EyjafjallaTag;
import com.megacrit.cardcrawl.actions.common.DrawCardAction;
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.core.CardCrawlGame;
import com.megacrit.cardcrawl.localization.CardStrings;
import com.megacrit.cardcrawl.monsters.AbstractMonster;

public class WaveFlower_Eyjafjalla extends AbstractEyjafjallaCard {
    public static final String ID = "WaveFlower_Eyjafjalla";
    private static final CardStrings cardStrings;

    public WaveFlower_Eyjafjalla(){
        super(ID, cardStrings.NAME,0,cardStrings.DESCRIPTION,CardType.SKILL,CardRarity.UNCOMMON,CardTarget.NONE);
        this.exhaust = true;

        this.baseMagicNumber = 2;
        this.magicNumber = 2;

        setFireDescription(cardStrings.EXTENDED_DESCRIPTION[0]);
    }

    @Override
    public AbstractCard makeCopy() {
        return new WaveFlower_Eyjafjalla();
    }

    @Override
    public void use(AbstractPlayer p, AbstractMonster m) {
        for(int i =0;i<this.magicNumber;i++)
            addToBot(new MelodyAction(EyjafjallaHelper.getRandomMelody()));
    }

    @Override
    public void applyPowers() {
        int trueM = baseMagicNumber;
        if(isFire()){
            baseMagicNumber++;
        }
        magicNumber = baseMagicNumber;
        baseMagicNumber = trueM;
        isMagicNumberModified = baseMagicNumber!=magicNumber;
        super.applyPowers();
    }

    @Override
    public void upgrade() {
        if(!this.upgraded){
            upgradeName();
            rawDescription = cardStrings.UPGRADE_DESCRIPTION;
            this.isInnate = true;
            initializeDescription();
        }
    }

    static {
        cardStrings = CardCrawlGame.languagePack.getCardStrings(ID);
    }
}





